1. Field of the Invention
The present invention generally relates to a method and system for scaling binary images, and more particularly to a method and system for changing the spatial resolution of an image by systematically generating a look-up table of pixel replacement patterns. Such a scaling method (and system) allows a user to easily control printer parameters such as dot gain and output bit depth.
2. Description of the Related Art
There are several known techniques for changing the spatial resolution of an image. One such method is referred to as scaling, where one or more pixels of an input image are replaced by one or more other pixels to generate an enhanced output image.
In general, given a scaling factor greater than one, scaling will increase the number of pixels of the input image. This is sometimes called “up-sampling”. By the same token, given a factor less than one, scaling will reduce the number of pixels of the input image. This sometimes is called “down-sampling”.
There are four main classes of image scaling, which include grayscale-to-grayscale image scaling, binary-to-binary image scaling, binary-to-grayscale image scaling and grayscale-to-binary image scaling. Look-Up-Table (LUT) algorithms are often used for scaling binary images. An input to the LUT includes an index of templates or patterns and the output of the LUT is the templates or patterns themselves which are used for replacing one or more pixels of an image to scale the binary image, denoted as replacement patterns here. Conventionally, both the index patterns and the replacement patterns in the LUT are manually and empirically created based on experiments.
Manually creating patterns empirically determines the patterns by using a trial and error process to create index patterns which capture all of the features in an image, and to create replacement patterns which are visually pleasing and produce a consistent transition from pattern to pattern. In addition, certain exceptions must be recognized such as preserving sharp edges for intersecting lines or preserving fine details such as isolated pixels.
Manually creating the patterns in the LUT is suboptimal and inflexible. That is, the number of manually created patterns is limited. Manually creating patterns assumes a given boldness or dot gain which cannot be adjusted to account for printer characteristics or changes in printer characteristics, thus producing a suboptimal and inflexible solution. Furthermore, some features of the binary image may be missed due to the limited number of index patterns and replacement patterns. This is due to the limited number of experiments that are normally performed in the manual techniques.
Another important consideration when scaling binary images is control of printer parameters, such as dot gain and output bit depth. Conventional binary image scaling methods require the user to manually create a set of patterns for each printer dot gain and for each output bit depth. These methods are also inflexible and inefficient, in terms of hardware implementation.
U.S. Pat. No. 6,151,025, incorporated herein by reference, describes a method of performing scaling of binary images by storing linear combinations of a row of pixels in a LUT. Several LUTs are needed for each level of dot gain. At runtime, several LUT operations are needed and the results are combined to determine the output.
Additionally, conventional image scaling methods require stored sets of patterns for specific fixed scaling ratios. Thus, in the conventional techniques, different scaling ratios require different sets of LUT's.